package com.gxa.sideParking.admin.controller;


import com.gxa.sideParking.admin.pojo.Manager;
import com.gxa.sideParking.admin.service.ManagerService;
import com.gxa.sideParking.core.common.JsonResult;
import com.gxa.sideParking.core.common.ResponseUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author gxa
 * @since 2022-10-05
 */
@RestController
@RequestMapping("/sideParking/manager")
public class ManagerController {

    @Autowired
    private ManagerService managerService;

    //分页查询所有
    @GetMapping("/findAll")
    public JsonResult findAll(Integer currentPage, Integer pageSize){
        return managerService.findAll(currentPage,pageSize);
    }

    //按时间查询
    @GetMapping("/findTime")
    public List<Manager> findTime(String managerDate){
        return managerService.findTime(managerDate);
    }

    //出账总金额查询
    @GetMapping("findOutMoney")
    public List<Manager> findOutMoney() {
//        JsonResult outMoney = managerService.findOutMoney();
//        return ResponseUtil.success("查询成功",outMoney);
        return managerService.findOutMoney();

    }

    //进账总资金查询
    @GetMapping("findPutMoney")
    public List<Manager> findPutMoney(){
        return managerService.findPutMoney();
    }

    //本周数据查询
    @GetMapping("findWeek")
    public List<Manager> findWeek() {
        return managerService.findWeek();
    }

    //本月数据查询
    @GetMapping("findMonth")
    public List<Manager> findMonth() {
        return managerService.findMonth();
    }

    //上月数据查询
    @GetMapping("findLastMonth")
    public List<Manager> findLastMonth() {
        return managerService.findLastMonth();
    }

}

